Drop root coordinates from _gdk_device_query_state
authorMatthias Clasen <mclasen@redhat.com>
Mon, 9 Mar 2020 19:16:01 +0000 (12:16 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 12 Mar 2020 19:30:11 +0000 (15:30 -0400)
Callers are not using them anyway. Update all callers.

gdk/broadway/gdkdevice-broadway.c
gdk/broadway/gdksurface-broadway.c
gdk/gdkdevice.c
gdk/gdkdeviceprivate.h
gdk/wayland/gdkdevice-wayland.c
gdk/wayland/gdksurface-wayland.c
gdk/win32/gdkdevice-virtual.c
gdk/win32/gdkdrag-win32.c
gdk/x11/gdkdevice-xi2.c
gdk/x11/gdkdrag-x11.c
gdk/x11/gdksurface-x11.c

index 52ffa719db6a68557fcd7619f8d2665e394510b2..837b48b4f0c9ea05da318c91f7b8d89be891afe8 100644 (file)
@@ -37,12 +37,10 @@ static void gdk_broadway_device_set_surface_cursor (GdkDevice *device,
                                                     GdkSurface *surface,
                                                     GdkCursor *cursor);
 static void gdk_broadway_device_query_state (GdkDevice        *device,
-                                             GdkSurface        *surface,
-                                             GdkSurface       **child_surface,
-                                             gdouble          *root_x,
-                                             gdouble          *root_y,
-                                             gdouble          *win_x,
-                                             gdouble          *win_y,
+                                             GdkSurface       *surface,
+                                             GdkSurface      **child_surface,
+                                             double           *win_x,
+                                             double           *win_y,
                                              GdkModifierType  *mask);
 static GdkGrabStatus gdk_broadway_device_grab   (GdkDevice     *device,
                                                  GdkSurface     *surface,
@@ -123,14 +121,12 @@ gdk_broadway_device_set_surface_cursor (GdkDevice *device,
 }
 
 static void
-gdk_broadway_device_query_state (GdkDevice        *device,
+gdk_broadway_device_query_state (GdkDevice         *device,
                                  GdkSurface        *surface,
                                  GdkSurface       **child_surface,
-                                 gdouble          *root_x,
-                                 gdouble          *root_y,
-                                 gdouble          *win_x,
-                                 gdouble          *win_y,
-                                 GdkModifierType  *mask)
+                                 double            *win_x,
+                                 double            *win_y,
+                                 GdkModifierType   *mask)
 {
   GdkDisplay *display;
   GdkBroadwayDisplay *broadway_display;
@@ -150,10 +146,6 @@ gdk_broadway_device_query_state (GdkDevice        *device,
                                     &device_root_y,
                                     &mask32);
 
-  if (root_x)
-    *root_x = device_root_x;
-  if (root_y)
-    *root_y = device_root_y;
   if (win_x)
     *win_x = device_root_x;
   if (win_y)
@@ -305,7 +297,7 @@ gdk_broadway_device_surface_at_position (GdkDevice       *device,
 {
   GdkSurface *surface = NULL;
 
-  gdk_broadway_device_query_state (device, NULL, &surface, NULL, NULL, win_x, win_y, mask);
+  gdk_broadway_device_query_state (device, NULL, &surface, win_x, win_y, mask);
 
   return surface;
 }
index b3ced7cf67059e9b9b2d40db00989fa096710edf..ed377a3ca3b1c60215d3c90df7e8c251059a4750 100644 (file)
@@ -667,7 +667,6 @@ gdk_broadway_surface_get_device_state (GdkSurface      *surface,
 
   GDK_DEVICE_GET_CLASS (device)->query_state (device, surface,
                                               &child,
-                                              NULL, NULL,
                                               x, y, mask);
   return child != NULL;
 }
index ac15dd6499f09ae20c7a35ca7f18358f58895ee4..2123dc1dd70276dabce93f8ea2d27b52d1141727 100644 (file)
@@ -526,7 +526,7 @@ gdk_device_get_position (GdkDevice *device,
   g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
                     gdk_display_device_is_grabbed (gdk_device_get_display (device), device));
 
-  _gdk_device_query_state (device, NULL, NULL, x, y, NULL, NULL, NULL);
+  _gdk_device_query_state (device, NULL, NULL, x, y, NULL);
 }
 
 /**
@@ -1508,8 +1508,6 @@ void
 _gdk_device_query_state (GdkDevice        *device,
                          GdkSurface        *surface,
                          GdkSurface       **child_surface,
-                         gdouble          *root_x,
-                         gdouble          *root_y,
                          gdouble          *win_x,
                          gdouble          *win_y,
                          GdkModifierType  *mask)
@@ -1517,8 +1515,6 @@ _gdk_device_query_state (GdkDevice        *device,
   GDK_DEVICE_GET_CLASS (device)->query_state (device,
                                               surface,
                                               child_surface,
-                                              root_x,
-                                              root_y,
                                               win_x,
                                               win_y,
                                               mask);
index 9135edaac2587bd208451b2ec0c66f798088f69f..7e74d38d3ed21986e53eb49754e8c27df35a8dd6 100644 (file)
@@ -88,8 +88,6 @@ struct _GdkDeviceClass
   void (* query_state)       (GdkDevice       *device,
                               GdkSurface       *surface,
                               GdkSurface      **child_surface,
-                              gdouble          *root_x,
-                              gdouble          *root_y,
                               gdouble          *win_x,
                               gdouble          *win_y,
                               GdkModifierType  *mask);
@@ -162,8 +160,6 @@ void _gdk_device_remove_slave (GdkDevice *device,
 void _gdk_device_query_state                  (GdkDevice        *device,
                                                GdkSurface        *surface,
                                                GdkSurface       **child_surface,
-                                               gdouble          *root_x,
-                                               gdouble          *root_y,
                                                gdouble          *win_x,
                                                gdouble          *win_y,
                                                GdkModifierType  *mask);
index f063563aae1e67be8428a296385545205fde14a9..0c850147f491065f951d385c099c4766daa19f4e 100644 (file)
@@ -551,15 +551,12 @@ static void
 gdk_wayland_device_query_state (GdkDevice        *device,
                                 GdkSurface       *surface,
                                 GdkSurface      **child_surface,
-                                gdouble          *root_x,
-                                gdouble          *root_y,
                                 gdouble          *win_x,
                                 gdouble          *win_y,
                                 GdkModifierType  *mask)
 {
   GdkWaylandPointerData *pointer;
   GList *children = NULL;
-  int x_root, y_root;
 
   if (surface == NULL)
     children = gdk_wayland_display_get_toplevel_surfaces (gdk_device_get_display (device));
@@ -576,24 +573,6 @@ gdk_wayland_device_query_state (GdkDevice        *device,
     *win_x = pointer->surface_x;
   if (win_y)
     *win_y = pointer->surface_y;
-
-  if (pointer->focus)
-    {
-      gdk_surface_get_root_coords (pointer->focus,
-                                  pointer->surface_x,
-                                  pointer->surface_y,
-                                  &x_root, &y_root);
-    }
-  else
-    {
-      x_root = pointer->surface_x;
-      y_root = pointer->surface_y;
-    }
-
-  if (root_x)
-    *root_x = x_root;
-  if (root_y)
-    *root_y = y_root;
 }
 
 static void
index 166a1399132523110e5f7705fd26bcb41232900a..d7bfbfb5ef56fa2c42b610927134975f2d4d5798 100644 (file)
@@ -2859,7 +2859,6 @@ gdk_wayland_surface_get_device_state (GdkSurface       *surface,
 
       GDK_DEVICE_GET_CLASS (device)->query_state (device, surface,
                                                   &child,
-                                                  NULL, NULL,
                                                   x, y, mask);
       return_val = (child != NULL);
     }
index d876e2608bbe6b6d0590094f1369bd48cf52cb28..4435cf5a20b01f416d83cbcba922436cfde05043 100644 (file)
@@ -116,8 +116,6 @@ static void
 gdk_device_virtual_query_state (GdkDevice        *device,
                                GdkSurface        *window,
                                GdkSurface       **child_window,
-                               gdouble          *root_x,
-                               gdouble          *root_y,
                                gdouble          *win_x,
                                gdouble          *win_y,
                                GdkModifierType  *mask)
@@ -126,7 +124,6 @@ gdk_device_virtual_query_state (GdkDevice        *device,
 
   _gdk_device_query_state (virtual->active_device,
                           window, child_window,
-                          root_x, root_y,
                           win_x, win_y,
                           mask);
 }
index 59b749add479e6ccb8bf17ff82fadcf7e0b0e8c1..e4084e0b6ba37417fc84f6ad6a68838285d84c86 100644 (file)
@@ -2440,7 +2440,7 @@ gdk_dnd_handle_key_event (GdkDrag  *drag,
   /* The state is not yet updated in the event, so we need
    * to query it here.
    */
-  _gdk_device_query_state (pointer, NULL, NULL, NULL, NULL, NULL, NULL, &state);
+  _gdk_device_query_state (pointer, NULL, NULL, NULL, NULL, &state);
 
   if (dx != 0 || dy != 0)
     {
index 40c0e8bb079b198c8740de06a2f62703fba82e23..8ec598f311d9076530c7c36e01e22435ef31f287 100644 (file)
@@ -80,8 +80,6 @@ static void gdk_x11_device_xi2_set_surface_cursor (GdkDevice *device,
 static void gdk_x11_device_xi2_query_state (GdkDevice        *device,
                                             GdkSurface        *surface,
                                             GdkSurface       **child_surface,
-                                            gdouble          *root_x,
-                                            gdouble          *root_y,
                                             gdouble          *win_x,
                                             gdouble          *win_y,
                                             GdkModifierType  *mask);
@@ -259,7 +257,6 @@ gdk_x11_device_xi2_get_state (GdkDevice       *device,
     gdk_x11_device_xi2_query_state (device, surface,
                                     NULL,
                                     NULL, NULL,
-                                    NULL, NULL,
                                     mask);
 }
 
@@ -289,8 +286,6 @@ static void
 gdk_x11_device_xi2_query_state (GdkDevice        *device,
                                 GdkSurface        *surface,
                                 GdkSurface       **child_surface,
-                                gdouble          *root_x,
-                                gdouble          *root_y,
                                 gdouble          *win_x,
                                 gdouble          *win_y,
                                 GdkModifierType  *mask)
@@ -324,7 +319,7 @@ gdk_x11_device_xi2_query_state (GdkDevice        *device,
 
       if (master)
         _gdk_device_query_state (master, surface, child_surface,
-                                 root_x, root_y, win_x, win_y, mask);
+                                 win_x, win_y, mask);
       return;
     }
 
@@ -366,12 +361,6 @@ gdk_x11_device_xi2_query_state (GdkDevice        *device,
   if (child_surface)
     *child_surface = gdk_x11_surface_lookup_for_display (display, xchild_window);
 
-  if (root_x)
-    *root_x = xroot_x / scale;
-
-  if (root_y)
-    *root_y = xroot_y / scale;
-
   if (win_x)
     *win_x = xwin_x / scale;
 
index b336cecc5907e91530b32b39834b15abf1643043..f2856b891b546e373e08e2e2bd384449d23c13f2 100644 (file)
@@ -2010,7 +2010,7 @@ _gdk_x11_surface_drag_begin (GdkSurface         *surface,
 
   precache_target_list (drag);
 
-  gdk_device_get_position (device, &px, &py);
+  _gdk_device_query_state (device, surface, NULL, &px, &py, NULL);
 
   gdk_x11_surface_get_root_coords (surface,
                                    round (px) + dx,
@@ -2264,7 +2264,7 @@ gdk_dnd_handle_key_event (GdkDrag           *drag,
    * to query it here. We could use XGetModifierMapping, but
    * that would be overkill.
    */
-  _gdk_device_query_state (pointer, NULL, NULL, NULL, NULL, NULL, NULL, &state);
+  _gdk_device_query_state (pointer, NULL, NULL, NULL, NULL, &state);
 
   if (dx != 0 || dy != 0)
     {
index 1be2f82accc3cc4c5b77effe6eeb0c1ef5be83aa..7276196f6389d801e54128eec1d7c21d401bd59a 100644 (file)
@@ -2589,7 +2589,6 @@ gdk_x11_surface_get_device_state (GdkSurface       *surface,
   /*HIDPI: handle coords here?*/
   GDK_DEVICE_GET_CLASS (device)->query_state (device, surface,
                                               &child,
-                                              NULL, NULL,
                                               x, y, mask);
   return child != NULL;
 }